<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: most_viewed.php 11 2013-09-21 11:43:11Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 11 $
* 	zuletzt geaendert von:	$Author: siekiera $
* 	Datum:					$Date: 2013-09-21 11:43:11 +0000 (Sat, 21 Sep 2013) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright (c) since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */

$get_products = $db->db_query_limit("	SELECT
											p.products_id,
											p.products_model,
											pd.products_name,
											pd.products_viewed
										FROM
											".TABLE_PRODUCTS." p,
											".TABLE_PRODUCTS_DESCRIPTION." pd
										WHERE
											p.products_id = pd.products_id
										AND
											pd.language_id = '".$_SESSION['languages_id']."'
										ORDER BY
											pd.products_viewed DESC", 10, true);
$i = 0;
?>
<table width="100%" class="dataTable">
	<tr>
		<td width="1px"><b>Nummer</b></td>
		<td><b>Artikel</b></td>
		<td align="center"><b>Besucht</b></td>
	</tr>
	<?php
		while(!$get_products->EOF){ $i++;
	?>
	<tr>
		<td><?php echo $i; ?></td>
		<td><?php echo  $get_products->fields['products_name'].(!empty($get_products->fields['products_model'])?' (<em class="fs85">ArtNr: '.$get_products->fields['products_model'].'</em>)':''); ?></td>
		<td align="center"><?php echo round($get_products->fields['products_viewed']/2, 0); ?></td>
	</tr>
	<?php
		$get_products->MoveNext();
	}
	?>
</table>